#ifndef GRAPHVIEW_H
#define GRAPHVIEW_H

#include <QWidget>
#include<QMouseEvent>
#include<QPainter>
#include<cmath>

static int inf=10000;

namespace Ui {
    class GraphView;
}

struct Edge{
    int start,end;
};

class GraphView:public QWidget
{
    Q_OBJECT
private:
    QPoint vertex[10000];
    //Edge edge[10000];

    int VertexCount=0;
    int EdgeCount=0;

    qreal adj[10000][10000];

    int ButtonState;

    bool SameVex(QPoint x,QPoint y);

    int start,end;
    int Y1,Y2,Y3,Y4;
    int S1,S2,S3;

    void paintEvent(QPaintEvent *event);
    void mousePressEvent(QMouseEvent *event);
    //void mouseReleaseEvent(QMouseEvent *event);
    //void mouseMoveEvent(QMouseEvent *event);
    void DelVex(int i);
    void AddVex(QPoint TempPos);
    void PrintAdj();

    Ui::GraphView* ui;

private slots:
    void on_pushButton_clicked();

    void on_pushButton_2_clicked();

    void on_pushButton_3_clicked();

    void on_pushButton_4_clicked();

    void on_pushButton_5_clicked();

    void on_pushButton_6_clicked();

    void on_pushButton_7_clicked();

    void on_pushButton_8_clicked();

    void on_pushButton_9_clicked();

    void on_pushButton_10_clicked();

    void on_pushButton_11_clicked();

    void on_pushButton_12_clicked();

public:
    explicit GraphView(QWidget* parent=0);
    ~GraphView();
};


#endif // GRAPHVIEW_H
